<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
     @media(max-width:767px){
            .form-group-xs{
            margin-left:0px !important;
            }
        }
         .text-left{
        color:#949494;
        }
        div.box-body {
    		margin-top:7px;
        
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></h1>
       <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></a></li>
        </ol>
    </section>
    <section class="content">
    <table class="infoBox">
      <tr>
        <td width="150px" class="infoBoxleft">
        <p style="color:#fff;font-size:20px;text-align:center;font-weight:600"><spring:message code="message.jieSuan.fuShen"/><spring:message code="message.listForm.xinXi"/></p>
        </td>
        <td>
        	<form  class="form-horizontal" id="form"  method="post" >
                <div class="box-body" style="background:url('${ctx }/lib/img/infobg.png') no-repeat bottom right;">
                    <div class="form-group form-group-xs"  style="margin-top:-5px;">
                    <label for="techPos" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left"> ${obj.settlementCode}</div>
                    <label for="techPosCertNo" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left">${obj.settlementName} </div>
                    </div>
                    
                    <div class="form-group form-group-xs" style="margin-top:-10px">
                     <label for="position" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongTiaoMuShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div class="col-sm-3 text-left">${obj.totalOrders}</div>
                     <label for="industry" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongJinE"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div class="col-sm-3 text-left">${obj.totalAmountStr}</div>
                    </div>
                    
                     <div class="form-group form-group-xs"  style="margin-top:-10px">
                     <label for="industry" class="col-sm-2 text-right"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.lable.remark"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div class="col-sm-3 text-left">${obj.remarks}</div>
                     <label for="name" class="col-sm-2 text-right"><spring:message code="message.listForm.shenHeBeiZhu"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div class="col-sm-3 text-left">${obj.auditRemark}</div>
                      </div> 
                      
                    
                   
                   <div class="form-group form-group-xs" style="margin-top:-10px;margin-bottom:-10px;">
                     <label for="name" class="col-sm-2 text-right"><spring:message code="message.jieSuan.fuShen"/><spring:message code="message.lable.remark"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div class="col-sm-9">
	                     <textarea class="form-control" rows="1" id="reauditRemark" name="reauditRemark" placeholder="<spring:message code="message.jieSuan.fuShen"/><spring:message code="message.lable.remark"/>" ></textarea>
	                 </div>
                    </div>
                </div>
             </form>
        </td>
      </tr>
      </table>
     
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
            <button type="button" class="btn btn-default btn-sm pass" ><spring:message code="message.listForm.tongGuoSpacing"/></button>
            <button type="button" class="btn btn-default btn-sm unpass" ><spring:message code="message.listForm.buTongGuo"/></button>
            <a href="hospSettleReauditList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
        </div>
            
    </section>
	<%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    function validate() {
   		var reauditRemark = $.trim($("#reauditRemark").val());
		if(reauditRemark.length>512){
			$.HN.message.alert("<spring:message code="message.jieSuan.fuShen"/><spring:message code="message.lable.remark"/><spring:message code="message.info.zuiDaChangDu"/>512<spring:message code="message.info.geZiFu"/><spring:message code="message.yanZheng.ganTanHao"/>", "<spring:message code="message.HN.alert.type"/>", "warn");
			return false;
		}
		return true;
	}
    $(function(){
    	if (!validate()) {return;} 
    	$('.pass').click(function(){
			 $.HN.message.confirm('<spring:message code="message.jieSuan.queDingTongGuoAudit"/>', '', '').on(function (e) {
                if (e) {
               	  $.post('reAuditPass.html', {settlementId: "${obj.settlementId}",reauditRemark:$('#reauditRemark').val()},
               		function (result) {
	               			if (result.success) {
	           					$.HN.message.alert("<spring:message code="message.HN.alert.success"/>", "<spring:message code="message.HN.alert.type"/>", "success", function() {
	           						document.location = "${ctx}/settlementFirst/hospSettleReauditList.html";
	           					});
	           				} else {
	           					$.HN.message.alert(result.msg || "<spring:message code="message.HN.alert.fail"/>", "<spring:message code="message.HN.alert.type"/>", "error");
	           				}
              			}, "json");
                }
   	     });
       });
   	$('.unpass').click(function(){
   		if (!validate()) {return;} 
			 $.HN.message.confirm('<spring:message code="message.jieSuan.queDingBuTongGuoAudit"/>', '', '').on(function (e) {
               if (e) {
                $.post('reAuditUnPass.html', {settlementId: "${obj.settlementId}",reauditRemark:$('#reauditRemark').val()}, 
               		 function (result) {
		         			if (result.success) {
		    					$.HN.message.alert("<spring:message code="message.HN.alert.success"/>", "<spring:message code="message.HN.alert.type"/>", "success", function() {
		    						document.location = "${ctx}/settlementFirst/hospSettleReauditList.html";
		    					});
		    				} else {
		    					$.HN.message.alert(result.msg || "<spring:message code="message.HN.alert.fail"/>", "<spring:message code="message.HN.alert.type"/>", "error");
		    				}
       		}, "json");
               }
  	     });
      });
    	
    	
    	
		$("#gridlist").jqGrid(
		{   url : "getChildSettlementList.html?settlementId=${obj.settlementId}",
			mtype : "POST",
			datatype : "json",
			autowidth : true,
                  shrinkToFit: false,
			height : 255,
			colNames : ['<spring:message code="message.jqGrid.cz"/>',
			            '<spring:message code="message.jieSuan.jieSuanDan"/>id',
			            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/>',
			            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/>',
			            '<spring:message code="message.listForm.yiLiaoJiGouBianMa"/>',
			            '<spring:message code="message.listForm.yiLiaoJiGouMingCheng"/>',
			            '<spring:message code="message.listForm.suoShuDiQu"/>',
			            '<spring:message code="message.jieSuan.zongTiaoMuShu"/>',
			            '<spring:message code="message.jieSuan.zongJinE"/>',
			            '<spring:message code="message.jieSuan.tiJiaoRen"/>',
			            '<spring:message code="message.jieSuan.tiJiaoShiJian"/>'
			            ],
			colModel : [
                {name : 'operate',index : 'operate',width : 60,align : "center",sortable:false,
	                 formatter:function(cellvalue, options, row){
		             var str = "";
		             str += "<a href='${ctx}/settlementFirst/toReauditChildHospSettleList.html?fatherSettlementId=${obj.settlementId}&settlementId="+row.settlementId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
		             return str;
	                 }
                },
				{name : 'settlementId',index : 'settlementId', hidden : true,width : 160,align : "center",sortable:false},
				{name : 'settlementCode',index : 'settlementCode', width : 160,align : "center",sortable:false},
				{name : 'settlementName',index : 'settlementName', width : 160,align : "left",sortable:false},
				{name : 'hospCode',index : 'heaBurCode', width : 120,align : "center",sortable:false},
				{name : 'hospName',index : 'heaBurName', width : 160,align : "left",sortable:false},
				{name : 'areaName',index : 'areaName', width : 100,align : "center",sortable:false},
				{name : 'totalOrders',index : 'totalOrders', width : 80,align : "right",sortable:false},
				{name : 'totalAmount',index : 'totalAmount', width : 100,align : "right",sortable:false,
					formatter:function(cellvalue, options, row){
                              return formatAmount(cellvalue);
                           }
				},
				{name : 'submitUser',index : 'submitUser', width : 160,align : "left",sortable:false},									
                            {name : 'submitDatetime',index : 'submitDatetime', width : 160,align : "center",sortable:false,
					formatter:function(cellvalue, options, row){
						if(cellvalue == null){
							cellvalue = ""
							return cellvalue;
						}else{
								return new Date(cellvalue).format("yyyy-MM-dd hh:mm:ss");
							}
						}
				}
				
			],
			rownumbers : true,
			pager : "#gridpage",
			viewrecords : true,
			caption : "<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.xiangQing"/><spring:message code="message.listForm.lieBiao"/>",
			//序号宽度自动变化
            gridComplete:function(){
                //序号列宽度自适应（参数为jqgridID）
                autoRNWidth("gridlist");
                //数据只有一条时默认选中（参数为jqgridID）
                selectByOneData("gridlist");
            },
			jsonReader : {
				repeatitems : false,
				id : "ids"
			}
		});
		
		
		$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
		$(window).trigger("resize");
    });

 </script>
</body>
</html>